package com.lwp.spring.startup;

import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Component;

/**
 * ApplicationContextAware 执行在 WebApplicationInitializer 之后,需要添加注解 @Component
 *
 * @author lanwenping
 * @version 1.0
 * @date 2020/6/7 13:37
 */
@Component
public class MyWebApplicationAware implements ApplicationContextAware {

    @Override
    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
        System.out.println(applicationContext);
        System.out.println(99999999);
    }
}
